#!/bin/bash
dev_name="mem_dev"
/sbin/insmod ./$dev_name.ko

rm -f /dev/mem_dev

major=$(awk "\$2 == \"$dev_name\" {print \$1} " /proc/devices)

echo "major is "$major

mknod /dev/$dev_name c $major 0
